package com.jiandaoshou.utils;

import android.content.Context;
import android.content.SharedPreferences;

import static android.R.attr.width;

/**
 * Created by Administrator on 2016/12/7.
 */

public class ShareUtil {
    public static ShareUtil shareUtil;
    public SharedPreferences sharedPreferences;
    public static ShareUtil getInstance() {
        if(shareUtil==null){
            shareUtil=new ShareUtil();
        }
        return shareUtil;
    }

    public SharedPreferences getPreferences(Context c){
        return c.getSharedPreferences("LoginInfo", 1);
    }

    public void putPassWord(Context c,String password){
        getPreferences(c).edit().putString("Password", password).commit();
    }

    public String GetPassWord(Context context){
        return getPreferences(context).getString("Password","");
    }
}
